import { useRef } from "react"

const useSocket=(user_id)=>{
    const wsRef=useRef()
    const connectSocket=()=>{
        wsRef.current=new WebSocket(`ws://81.70.224.2:8003/koa/ws?user_id=${user_id}&server_id=900`)
    }
    return {connectSocket,wsRef}
}
export default useSocket